package webInterface;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * this class handles the web login page
 */
public class Login extends HttpServlet
{
	/*
	 * this function handles the login page
	 */
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    {
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();

        // creating a form asking for user name and password with a submit button
        out.println("<html>");
        out.println("<head>");
        out.println("<title>Servlet Login</title>");
        out.println("</head>");
        out.println("<body>");
        out.println("	<form action=\"webInterface.LoginValidation\" method=\"POST\"> \n User Name: <input type=\"text\" name=\"UserName\" size=\"20\"><br> \n Password: <input type=\"password\" name=\"Password\" size=\"20\"> <br> \n <br> <input type=\"submit\" value=\"Submit\"> \n </form>\n");
        out.println("</body>");
        out.println("</html>");
        out.close();
    }
}
